const TOKEN = "___token___"; //token
const CURRENTPATH = "___current_path___"; //当前路径

export default {
	/**
	 * 存储token
	 */
	setToken(token) {
		uni.setStorageSync(TOKEN, token);
	},
	/**
	 * 获取token
	 */
	getToken() {
		return uni.getStorageSync(TOKEN) || "";
		// return uni.getStorageSync(TOKEN) || "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjUsImV4cCI6MTc0OTc4NTIwNywiaWF0IjoxNzE4MjQ5MjA3LCJuYmYiOjE3MTgyNDkyMDd9.6UQJvHh0Lrdeq_ybxTuuhpkgMKNP7ZYiLluy6mQbw3E";
	},
	/**
	 * 清除token
	 */
	clearToken() {
		uni.removeStorageSync(TOKEN);
	},
	
	/**
	 * 存储当前路径
	 */
	setCurrentPath(path) {
		uni.setStorageSync(CURRENTPATH, path);
	},
	/**
	 * 获取当前路径
	 */
	getCurrentPath() {
		return uni.getStorageSync(CURRENTPATH) || "/pages/home/home";
	},
	/**
	 * 清除存储的路径
	 */
	clearCurrentPath() {
		uni.removeStorageSync(CURRENTPATH);
	}
}